function fetchData(url, method) {
    return new Promise((resolve, reject) => {
        $.ajax({
            url,
            method: method ? method : "GET",
            headers: {
                authorization: localStorage.getItem('token') ? localStorage.getItem('token') : ''
            },
            success: (res) => {

                resolve(res)
                reject()

            }
        })
    })
}